

section	.text

global __in_c
global __in_w
global __in_d
global __out_c
global __out_w
global __out_d


__in_c:
	push	ebp
	mov	ebp,	esp
	push	edx
	mov	dx,	word [ebp + 8]
	in	al,	dx
	pop	edx
	pop	ebp
	ret

__in_w:
	push	ebp
	mov	ebp,	esp
	push	edx
	mov	dx,	word [ebp + 8]
	in	ax,	dx
	pop	edx
	pop	ebp
	ret

__in_d:
	push	ebp
	mov	ebp,	esp
	push	edx
	mov	dx,	word [ebp + 8]
	in	eax,	dx
	pop	edx
	pop	ebp
	ret


__out_c:
	push	ebp
	mov	ebp,	esp
	push	eax
	push	edx
	mov	dx,	word [ebp + 8]
	mov	al,	byte [ebp + 12]
	out	dx,	al
	pop	edx
	pop	eax
	pop	ebp
	ret

__out_w:
	push	ebp
	mov	ebp,	esp
	push	eax
	push	edx
	mov	dx,	word [ebp + 8]
	mov	ax,	word [ebp + 12]
	out	dx,	ax
	pop	edx
	pop	eax
	pop	ebp
	ret

__out_d:
	push	ebp
	mov	ebp,	esp
	push	eax
	push	edx
	mov	dx,	word [ebp + 8]
	mov	eax,	dword [ebp + 12]
	out	dx,	eax
	pop	edx
	pop	eax
	pop	ebp
	ret
